# -*- coding:utf-8 -*-

from fastapi import Depends
from sqlalchemy.orm import Session

from app.models.data.topic import TbTopic, TbTag, TbAttachment
from app.models.request.topic import Topic, Tag, Attachment
from app.repository.core import BaseRepository

from core.database import get_db

class TopicRepository(BaseRepository):
    def __init__(self, db: Session=Depends(get_db)):
        self.db = db
        self.table = TbTopic
        self.model = Topic
       
class TagRepository(BaseRepository):
    def __init__(self, db: Session=Depends(get_db)):
        self.db = db
        self.table = TbTag
        self.model = Tag
       
class AttachmentRepository(BaseRepository):
    def __init__(self, db: Session=Depends(get_db)):
        self.db = db
        self.table = TbAttachment
        self.model = Attachment
       
